import { ButtonInterFace } from '../../IButton/src/ButtonInterFace'

// 整体表格权限控制
export interface AuthControlInterFace {
    export?: boolean; // 是否展示导出
    import?: boolean; // 是否显示导入
    print?: boolean; // 是否显示打印
    isCheckBox?: boolean; // 是否显示复选框
    isRadio?: boolean;
    columnDrop?: boolean; // 是否可以拖拽
    toolbarCustom?: boolean; // 展示自定义
    isAutoSelect?:boolean;
    [index: string]: boolean | undefined;
}
// callback自定义查询方法返回值展示入参接口T
export interface ResultInterFace<T> {
    total?: number;
    resultList: T[] |[];
    checkList?: T[] |[];
}
// 配置vxe-tabel的基础属性具体可查询api
interface SearchFilterInterFace {
    type:string;
    placeholder?:string;
    list?:Array<any>;
    filterMultiple?:boolean;
}
/**
 * 分页入参接口. 默认配置为
 *  total: 0,
    currentPage: 1,
    pageSize: 10,
    pageSizeOptions: ['10', '20', '50', '100', '200', '1000']
 */
export interface PageInfoInterFace {
    total: number; // 总条数
    currentPage: number; // 当前页码
    options:any,
    pageSize: number; // 每页数量
    pageSizeOptions?: string[]|number[]// 每页展示数量
}
// 配置vxe-tabel的基础属性具体可查询api
export interface ScolumnsInterFace {
    [index: string]: any;
    title:string;
    field?:string;
    fixed?:string;
    showOverflow?:boolean;
    width?:number;
    visible?:boolean;
    format?:string;
    slots?:any;
    isCheck?:boolean;
    sortable?:boolean;
    searchFilter?:SearchFilterInterFace
}
// 配置vxe-tabel的基础属性具体可查询api
export interface TableInfoInterFace {
    columns:ScolumnsInterFace[];
    data:Array<any>;
    template?:string;
    titleTemplate?:string;
    [index: string]: any;
}

// 操作栏配置接口
interface OperationInterFace {
    label: string;// 操作栏名称
    displaySize?:number;
    // width: number | string;// 操作栏宽度
    // eslint-disable-next-line no-use-before-define
    dataList: OperationOptionsInterFace[]; // 操作栏集合
}
// 操作栏内每个方法配置
export interface TitleOptionsInterFace extends ButtonInterFace {
    buttonFun?: string;
    width?:string
    template?: string;
    position?: string;// left|right   顶部按钮位置
    [index:string]:any
    // label:string;
    // isShow:boolean;
    // Fun?:string;
    // remindData?:remindDataInterFace;
    // options?:any
}
// interface remindDataInterFace{
//     icon?:any;
//     isShow:boolean;
//     remindTitle:string;
//     remindContext:string;
//   }
// 操作栏内每个方法配置
export interface OperationOptionsInterFace extends ButtonInterFace {
    buttonFun?: string;
    template?: string;
    width:number;
    // label:string;
    // isShow:boolean;
    // Fun?:string;
    // remindData?:remindDataInterFace;
    // options?:any
}
// interface remindDataInterFace{
//     icon?:any;
//     isShow:boolean;
//     remindTitle:string;
//     remindContext:string;
//   }
// vxe-table封装表格入参接口
export interface TableDataInterFace{
    loading?:boolean;
    type:string; // 当前表格类型
    rowspanList?:string[];
    callback(arg0: any, arg1?:any): Promise<any>;// 查询数据回调方法
    tableInfo:TableInfoInterFace; // 配置vxe-tabel的基础属性具体可查询api
    pageInfo?:PageInfoInterFace|undefined;// pageInfo==undefined 则不展示
    operation?:OperationInterFace; // 操作栏
    authControl?:AuthControlInterFace; // 功能权限
    titleOperation?:TitleOptionsInterFace[] // 顶部功能按钮
    [index: string]: any;
}
